package student.convert

import org.apache.flink.api.common.serialization.SimpleStringSchema
import org.apache.flink.streaming.api.scala._
import org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer

import java.util.Properties

object KafkaRead {
  def main(args: Array[String]): Unit = {
    val env = StreamExecutionEnvironment.getExecutionEnvironment
    val properties = new Properties()
    properties.setProperty("bootstrap.servers","192.168.220.131:9092")
    properties.setProperty("group.id","flink-group")
    env.addSource(new FlinkKafkaConsumer[String]("test",new SimpleStringSchema(),properties))
      .print()
    env.execute()
  }
}
